﻿using System;
using System.Collections.Generic;

using System.Text;
using QUANLYCHAMCONG.BL.Entities;
using QUANLYCHAMCONG.BL.Entities.Security;
using QUANLYCHAMCONG.DAO.DAO.Security;
using System.Data;

namespace QUANLYCHAMCONG.BL.BUS.Security
{
    public class USERBUS
    {
        public USERBUS() { }
        public static bool Insert(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.Insert(user);
        }
        public static bool Update(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.Update(user);
        }
        public static bool Delete(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.Delete(user);
        }
        public static DataTable SelectAll()
        {
            USERDAO dao = new USERDAO();
            return dao.SelectALL();
        }
        public static DataTable SelectPK(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.SelectByPK(user);
        }
        public static string GetID()
        {
            USERDAO dao = new USERDAO();
            return "US" + dao.GetID().ToString();
        }
        public static bool IsExists(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.ISExists(user);
        }
        public static DataTable IsDuplicateUserName(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.IsDulicateUserName(user);
        }
        public static bool IsLogin(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.IsLogin(user);
        }
        public static bool Changepassword(USER user)
        {
            USERDAO dao = new USERDAO();
            return dao.Changepassword(user);
        }
    }
}
